<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ taglib uri="/tag" prefix="tag"%>
<tag:customerLogonCheck/>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>用户个人中心</title>
<link href="../style/common.css" rel="stylesheet" type="text/css" />

<style type="text/css">
	#main{margin: 0 auto;width: 960px;padding-bottom: 20px;margin-top: 5px;background: #ffffff;border: 1px solid #ccc;}
	.list_table {margin: 0 auto;margin-top: 20px;}
	.list_table td{ text-align: center;font-family: 宋体;font-size: 12px;}
</style>
</head>

<body>

	<%@include file="/commons/head.jsp"%>
	
	<%@include file="/user/customer_menu.jsp"%>
	
	<div id="main">
		<form action="${ctx }/customer/order!listNotPay.do" id="searchForm" name="searchForm" method="post">
			<table width="910" border="0" cellpadding="0" cellspacing="1" bordercolor="#cccccc" bgcolor="#cccccc" class="list_table">
	                 <tr bgcolor="#fffae6">
	                    <td height="35">订单号</td>
	                    <td>商品名称</td>
	                    <td>订单金额</td>
	                    <td>数量</td>
	                    <td>下单时间</td>
	                    <td>交易类型</td>
	                    <td>操作</td>
	                 </tr>
	                 <c:forEach items="${page.result}" var="result" varStatus="status">
	                   <tr bgcolor="#FFFFFF">
		                    <td height="30">${result.order.sequenceNo }</td>
		                    <td>${result.goods.name }</td>
		                    <td>${result.order.order_amount }</td>
		                    <td>${result.num }</td>
		                    <td><fmt:formatDate value="${result.order.orderTime }" pattern="yyyy-MM-dd HH:mm"/></td>
		                    <td>在线购买</td>
		                    <td>
		                    	<c:choose>
		                    		<c:when test="${result.order.status == 0}">
		                    			 <input type="button" value="去付款" name="btn_pay" id="btn_pay${status.index }" alt="${result.order.id }" class="btn_pay"/>
		                    		</c:when>
		                    		<c:otherwise>${result.order.orderStatus}</c:otherwise>
		                    	</c:choose>
		                    </td>
	                   </tr>
	                </c:forEach>
	              <tr bgcolor="#FFFFFF">
	             		<td colspan="7" height="35" style="text-align: right;padding-right: 30px;"><jsp:include page="/commons/paging_footer.jsp"/></td>
	           	  </tr>
	         </table>
	     </form>
	</div>
	
<%@ include file="/commons/foot.jsp" %>

<script type="text/javascript">
$(function(){
	$(".btn_pay").click(function(){
		var oId = $(this).attr("alt");
		location.href = "${ctx }/customer/paywidget!pay_confirm.do?orderid="+oId;
	});
});
</script>
</body>
</html>